3.1.5 \(\int \frac {(a+b x^2) (c+d x^2)}{e+f x^2} \, dx\) [5]

Optimal. Leaf size=81 \[ -\frac {(3 b d e-3 b c f-2 a d f) x}{3 f^2}+\frac {d x \left (a+b x^2\right )}{3 f}+\frac {(b e-a f) (d e-c f) \tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {e}}\right )}{\sqrt {e} f^{5/2}} \]

[Out]

-1/3*(-2*a*d*f-3*b*c*f+3*b*d*e)*x/f^2+1/3*d*x*(b*x^2+a)/f+(-a*f+b*e)*(-c*f+d*e)*arctan(x*f^(1/2)/e^(1/2))/f^(5
/2)/e^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {542, 396, 211} \begin {gather*} \frac {(b e-a f) \text {ArcTan}\left (\frac {\sqrt {f} x}{\sqrt {e}}\right ) (d e-c f)}{\sqrt {e} f^{5/2}}-\frac {x (-2 a d f-3 b c f+3 b d e)}{3 f^2}+\frac {d x \left (a+b x^2\right )}{3 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a + b*x^2)*(c + d*x^2))/(e + f*x^2),x]

[Out]

-1/3*((3*b*d*e - 3*b*c*f - 2*a*d*f)*x)/f^2 + (d*x*(a + b*x^2))/(3*f) + ((b*e - a*f)*(d*e - c*f)*ArcTan[(Sqrt[f
]*x)/Sqrt[e]])/(Sqrt[e]*f^(5/2))

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 542

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.)*((e_) + (f_.)*(x_)^(n_)), x_Symbol] :> Simp[
f*x*(a + b*x^n)^(p + 1)*((c + d*x^n)^q/(b*(n*(p + q + 1) + 1))), x] + Dist[1/(b*(n*(p + q + 1) + 1)), Int[(a +
 b*x^n)^p*(c + d*x^n)^(q - 1)*Simp[c*(b*e - a*f + b*e*n*(p + q + 1)) + (d*(b*e - a*f) + f*n*q*(b*c - a*d) + b*
d*e*n*(p + q + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && GtQ[q, 0] && NeQ[n*(p + q + 1) + 1
, 0]

Rubi steps

\begin {align*} \int \frac {\left (a+b x^2\right ) \left (c+d x^2\right )}{e+f x^2} \, dx &=\frac {d x \left (a+b x^2\right )}{3 f}+\frac {\int \frac {-a (d e-3 c f)-(3 b d e-3 b c f-2 a d f) x^2}{e+f x^2} \, dx}{3 f}\\ &=-\frac {(3 b d e-3 b c f-2 a d f) x}{3 f^2}+\frac {d x \left (a+b x^2\right )}{3 f}+\frac {((b e-a f) (d e-c f)) \int \frac {1}{e+f x^2} \, dx}{f^2}\\ &=-\frac {(3 b d e-3 b c f-2 a d f) x}{3 f^2}+\frac {d x \left (a+b x^2\right )}{3 f}+\frac {(b e-a f) (d e-c f) \tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {e}}\right )}{\sqrt {e} f^{5/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 72, normalized size = 0.89 \begin {gather*} \frac {(-b d e+b c f+a d f) x}{f^2}+\frac {b d x^3}{3 f}+\frac {(b e-a f) (d e-c f) \tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {e}}\right )}{\sqrt {e} f^{5/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x^2)*(c + d*x^2))/(e + f*x^2),x]

[Out]

((-(b*d*e) + b*c*f + a*d*f)*x)/f^2 + (b*d*x^3)/(3*f) + ((b*e - a*f)*(d*e - c*f)*ArcTan[(Sqrt[f]*x)/Sqrt[e]])/(
Sqrt[e]*f^(5/2))

________________________________________________________________________________________

Maple [A]
time = 0.14, size = 74, normalized size = 0.91

method result size
default \(\frac {\frac {1}{3} b d \,x^{3} f +a d f x +b c f x -b d e x}{f^{2}}+\frac {\left (a c \,f^{2}-a d e f -b c e f +b d \,e^{2}\right ) \arctan \left (\frac {f x}{\sqrt {f e}}\right )}{f^{2} \sqrt {f e}}\) \(74\)
risch \(\frac {b d \,x^{3}}{3 f}+\frac {a d x}{f}+\frac {b c x}{f}-\frac {b d e x}{f^{2}}-\frac {\ln \left (f x +\sqrt {-f e}\right ) a c}{2 \sqrt {-f e}}+\frac {\ln \left (f x +\sqrt {-f e}\right ) a d e}{2 f \sqrt {-f e}}+\frac {\ln \left (f x +\sqrt {-f e}\right ) b c e}{2 f \sqrt {-f e}}-\frac {\ln \left (f x +\sqrt {-f e}\right ) b d \,e^{2}}{2 f^{2} \sqrt {-f e}}+\frac {\ln \left (-f x +\sqrt {-f e}\right ) a c}{2 \sqrt {-f e}}-\frac {\ln \left (-f x +\sqrt {-f e}\right ) a d e}{2 f \sqrt {-f e}}-\frac {\ln \left (-f x +\sqrt {-f e}\right ) b c e}{2 f \sqrt {-f e}}+\frac {\ln \left (-f x +\sqrt {-f e}\right ) b d \,e^{2}}{2 f^{2} \sqrt {-f e}}\) \(235\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^2+a)*(d*x^2+c)/(f*x^2+e),x,method=_RETURNVERBOSE)

[Out]

1/f^2*(1/3*b*d*x^3*f+a*d*f*x+b*c*f*x-b*d*e*x)+(a*c*f^2-a*d*e*f-b*c*e*f+b*d*e^2)/f^2/(f*e)^(1/2)*arctan(f*x/(f*
e)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 73, normalized size = 0.90 \begin {gather*} \frac {{\left (a c f^{2} + b d e^{2} - {\left (b c e + a d e\right )} f\right )} \arctan \left (\sqrt {f} x e^{\left (-\frac {1}{2}\right )}\right ) e^{\left (-\frac {1}{2}\right )}}{f^{\frac {5}{2}}} + \frac {b d f x^{3} - 3 \, {\left (b d e - {\left (b c + a d\right )} f\right )} x}{3 \, f^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)*(d*x^2+c)/(f*x^2+e),x, algorithm="maxima")

[Out]

(a*c*f^2 + b*d*e^2 - (b*c*e + a*d*e)*f)*arctan(sqrt(f)*x*e^(-1/2))*e^(-1/2)/f^(5/2) + 1/3*(b*d*f*x^3 - 3*(b*d*
e - (b*c + a*d)*f)*x)/f^2

________________________________________________________________________________________

Fricas [A]
time = 0.95, size = 191, normalized size = 2.36 \begin {gather*} \left [-\frac {{\left (6 \, b d f x e^{2} + 3 \, {\left (a c f^{2} + b d e^{2} - {\left (b c + a d\right )} f e\right )} \sqrt {-f e} \log \left (\frac {f x^{2} - 2 \, \sqrt {-f e} x - e}{f x^{2} + e}\right ) - 2 \, {\left (b d f^{2} x^{3} + 3 \, {\left (b c + a d\right )} f^{2} x\right )} e\right )} e^{\left (-1\right )}}{6 \, f^{3}}, -\frac {{\left (3 \, b d f x e^{2} - 3 \, {\left (a c f^{2} + b d e^{2} - {\left (b c + a d\right )} f e\right )} \sqrt {f} \arctan \left (\sqrt {f} x e^{\left (-\frac {1}{2}\right )}\right ) e^{\frac {1}{2}} - {\left (b d f^{2} x^{3} + 3 \, {\left (b c + a d\right )} f^{2} x\right )} e\right )} e^{\left (-1\right )}}{3 \, f^{3}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)*(d*x^2+c)/(f*x^2+e),x, algorithm="fricas")

[Out]

[-1/6*(6*b*d*f*x*e^2 + 3*(a*c*f^2 + b*d*e^2 - (b*c + a*d)*f*e)*sqrt(-f*e)*log((f*x^2 - 2*sqrt(-f*e)*x - e)/(f*
x^2 + e)) - 2*(b*d*f^2*x^3 + 3*(b*c + a*d)*f^2*x)*e)*e^(-1)/f^3, -1/3*(3*b*d*f*x*e^2 - 3*(a*c*f^2 + b*d*e^2 -
(b*c + a*d)*f*e)*sqrt(f)*arctan(sqrt(f)*x*e^(-1/2))*e^(1/2) - (b*d*f^2*x^3 + 3*(b*c + a*d)*f^2*x)*e)*e^(-1)/f^
3]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 206 vs. \(2 (73) = 146\).
time = 0.39, size = 206, normalized size = 2.54 \begin {gather*} \frac {b d x^{3}}{3 f} + x \left (\frac {a d}{f} + \frac {b c}{f} - \frac {b d e}{f^{2}}\right ) - \frac {\sqrt {- \frac {1}{e f^{5}}} \left (a f - b e\right ) \left (c f - d e\right ) \log {\left (- \frac {e f^{2} \sqrt {- \frac {1}{e f^{5}}} \left (a f - b e\right ) \left (c f - d e\right )}{a c f^{2} - a d e f - b c e f + b d e^{2}} + x \right )}}{2} + \frac {\sqrt {- \frac {1}{e f^{5}}} \left (a f - b e\right ) \left (c f - d e\right ) \log {\left (\frac {e f^{2} \sqrt {- \frac {1}{e f^{5}}} \left (a f - b e\right ) \left (c f - d e\right )}{a c f^{2} - a d e f - b c e f + b d e^{2}} + x \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x**2+a)*(d*x**2+c)/(f*x**2+e),x)

[Out]

b*d*x**3/(3*f) + x*(a*d/f + b*c/f - b*d*e/f**2) - sqrt(-1/(e*f**5))*(a*f - b*e)*(c*f - d*e)*log(-e*f**2*sqrt(-
1/(e*f**5))*(a*f - b*e)*(c*f - d*e)/(a*c*f**2 - a*d*e*f - b*c*e*f + b*d*e**2) + x)/2 + sqrt(-1/(e*f**5))*(a*f
- b*e)*(c*f - d*e)*log(e*f**2*sqrt(-1/(e*f**5))*(a*f - b*e)*(c*f - d*e)/(a*c*f**2 - a*d*e*f - b*c*e*f + b*d*e*
*2) + x)/2

________________________________________________________________________________________

Giac [A]
time = 1.18, size = 80, normalized size = 0.99 \begin {gather*} \frac {{\left (a c f^{2} - b c f e - a d f e + b d e^{2}\right )} \arctan \left (\sqrt {f} x e^{\left (-\frac {1}{2}\right )}\right ) e^{\left (-\frac {1}{2}\right )}}{f^{\frac {5}{2}}} + \frac {b d f^{2} x^{3} + 3 \, b c f^{2} x + 3 \, a d f^{2} x - 3 \, b d f x e}{3 \, f^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)*(d*x^2+c)/(f*x^2+e),x, algorithm="giac")

[Out]

(a*c*f^2 - b*c*f*e - a*d*f*e + b*d*e^2)*arctan(sqrt(f)*x*e^(-1/2))*e^(-1/2)/f^(5/2) + 1/3*(b*d*f^2*x^3 + 3*b*c
*f^2*x + 3*a*d*f^2*x - 3*b*d*f*x*e)/f^3

________________________________________________________________________________________

Mupad [B]
time = 0.11, size = 108, normalized size = 1.33 \begin {gather*} x\,\left (\frac {a\,d+b\,c}{f}-\frac {b\,d\,e}{f^2}\right )+\frac {b\,d\,x^3}{3\,f}+\frac {\mathrm {atan}\left (\frac {\sqrt {f}\,x\,\left (a\,f-b\,e\right )\,\left (c\,f-d\,e\right )}{\sqrt {e}\,\left (a\,c\,f^2+b\,d\,e^2-a\,d\,e\,f-b\,c\,e\,f\right )}\right )\,\left (a\,f-b\,e\right )\,\left (c\,f-d\,e\right )}{\sqrt {e}\,f^{5/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((a + b*x^2)*(c + d*x^2))/(e + f*x^2),x)

[Out]

x*((a*d + b*c)/f - (b*d*e)/f^2) + (b*d*x^3)/(3*f) + (atan((f^(1/2)*x*(a*f - b*e)*(c*f - d*e))/(e^(1/2)*(a*c*f^
2 + b*d*e^2 - a*d*e*f - b*c*e*f)))*(a*f - b*e)*(c*f - d*e))/(e^(1/2)*f^(5/2))

________________________________________________________________________________________